﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace IRC.IRepairClouds.DataLayer
{
    [Serializable]
    public struct MultiKeyValuePair<TKey, TValue>
    {
        private TKey[] keys;
        private TValue value;

        public MultiKeyValuePair(TKey[] keys, TValue value)
        {
            this.keys = keys;
            this.value = value;
        }

        public TKey[] Keys
        {
            get { return this.keys; }
        }

        public TValue Value
        {
            get { return this.value; }
        }

        public override string ToString()
        {
            StringBuilder builder = new StringBuilder();
            builder.Append("[{");
            if (this.Keys != null) {
                for (int i = 0; i < this.Keys.Length; i++) {
                    builder.Append(this.Keys[i].ToString());
                    builder.Append(";");
                }
            }
            builder.Append("}, ");
            if (this.Value != null) {
                builder.Append(this.Value.ToString());
            }
            builder.Append(']');
            return builder.ToString();
        }
    }
}
